package com.collect.senegal.zhiBean.zhiReceive;

import com.collect.senegal.zhiUtils.StringUtil;

import java.io.Serializable;
import java.util.ArrayList;

public class ZHIRLoginEntity implements Serializable {

    /**
     * 用户名
     */
    private String userName;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户token
     */
    private String token;

    /**
     * 用户登录id
     */
    private String loginId;

    /**
     * 催收组长名下组员列表
     */
    private ArrayList<String> groupUserLoginNameList;

    /**
     * 客服组长名下组员列表
     */
    private ArrayList<String> customerDGroupUserLoginNameList;

    /**
     * 级别
     */
    private String defaultLeven;

    /**
     * 是否要做人脸标志
     */
    private String liveFlag;

    /**
     * 打白名单的客服角色
     */
    private String customerWhitelistFlag;

    /**
     * 客服角色
     */
    private String customerFlag;

    /**
     * 组长角色
     */
    private String groupFlag;

    /**
     * 电核角色
     */
    private String dhFlag;

    /**
     * 单人审核角色
     */
    private String wholeKefuFlag;

    /**
     * 大组长角色
     */
    private String bigGroupFlag;

    /**
     * 电销角色
     */
    private String dxFlag;

    /**
     * 客服组长角色
     */
    private String customerDGroupFlag;

    /**
     * 改钱包客服角色
     */
    private String customerChangeWalletFlag;

    public String getUserName() {
        return StringUtil.safeString(userName);
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserId() {
        return StringUtil.safeString(userId);
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCustomerFlag() {
        return StringUtil.safeString(customerFlag);
    }

    public boolean isCustomerFlag() {
        return getCustomerFlag().equalsIgnoreCase("YES");
    }

    public void setCustomerFlag(String customerFlag) {
        this.customerFlag = customerFlag;
    }

    public String getCustomerWhitelistFlag() {
        return StringUtil.safeString(customerWhitelistFlag);
    }

    public boolean isCustomerWhitelistFlag() {
        return getCustomerWhitelistFlag().equalsIgnoreCase("YES");
    }

    public void setCustomerWhitelistFlag(String customerWhitelistFlag) {
        this.customerWhitelistFlag = customerWhitelistFlag;
    }

    public String getDefaultLeven() {
        return StringUtil.safeString(defaultLeven);
    }

    public String getDefaultLevenApiFormat() {
        String tempLevel = StringUtil.safeString(defaultLeven);

        try {
            //order需要转M
            tempLevel = tempLevel.replaceAll("\\+", "");
            tempLevel = tempLevel.replaceAll("B", "M");

        } catch (Exception e) {
            e.printStackTrace();
        }

        return tempLevel;
    }

    public void setDefaultLeven(String defaultLeven) {
        this.defaultLeven = defaultLeven;
    }

    public String getGroupFlag() {
        return StringUtil.safeString(groupFlag);
    }

    public void setGroupFlag(String groupFlag) {
        this.groupFlag = groupFlag;
    }

    public ArrayList<String> getGroupUserLoginNameList() {
        if (groupUserLoginNameList == null) {
            groupUserLoginNameList = new ArrayList<>();
        }
        return groupUserLoginNameList;
    }

    public void setGroupUserLoginNameList(ArrayList<String> groupUserLoginNameList) {
        this.groupUserLoginNameList = groupUserLoginNameList;
    }

    public boolean isGroupFlag() {
        return getGroupFlag().contains("YES");
    }

    public boolean isLevelBPlus() {
        return getDefaultLeven().contains("B3") || getDefaultLeven().contains("M3");
    }

    public boolean isLevelB1() {
        return getDefaultLeven().contains("B1") || getDefaultLeven().contains("M1");
    }

    public boolean isLevelB2() {
        return getDefaultLeven().contains("B2") || getDefaultLeven().contains("M2");
    }

    public String getDxFlag() {
        return StringUtil.safeString(dxFlag);
    }

    public void setDxFlag(String dxFlag) {
        this.dxFlag = dxFlag;
    }

    public boolean isDxFlag() {
        return getDxFlag().contains("YES");
    }

    public String getDhFlag() {
        return StringUtil.safeString(dhFlag);
    }

    public void setDhFlag(String dhFlag) {
        this.dhFlag = dhFlag;
    }

    public boolean isDhFlag() {
        return getDhFlag().contains("YES");
    }

    public String getWholeKefuFlag() {
        return StringUtil.safeString(wholeKefuFlag);
    }

    public void setWholeKefuFlag(String wholeKefuFlag) {
        this.wholeKefuFlag = wholeKefuFlag;
    }

    public boolean isWholeKefuFlag() {
        return getWholeKefuFlag().equalsIgnoreCase("YES");
    }

    public String getCustomerDGroupFlag() {
        return StringUtil.safeString(customerDGroupFlag);
    }

    public boolean isCustomerDGroupFlag() {
        return getCustomerDGroupFlag().equalsIgnoreCase("YES");
    }

    public void setCustomerDGroupFlag(String customerDGroupFlag) {
        this.customerDGroupFlag = customerDGroupFlag;
    }

    public ArrayList<String> getCustomerDGroupUserLoginNameList() {
        if (customerDGroupUserLoginNameList == null) {
            customerDGroupUserLoginNameList = new ArrayList<>();
        }
        return customerDGroupUserLoginNameList;
    }

    public void setCustomerDGroupUserLoginNameList(ArrayList<String> customerDGroupUserLoginNameList) {
        this.customerDGroupUserLoginNameList = customerDGroupUserLoginNameList;
    }

    public String getBigGroupFlag() {
        return StringUtil.safeString(bigGroupFlag);

    }

    public void setBigGroupFlag(String bigGroupFlag) {
        this.bigGroupFlag = bigGroupFlag;
    }

    public boolean isBigGroupFlag() {
        return getBigGroupFlag().equalsIgnoreCase("YES");
    }

    public String getToken() {
        return StringUtil.safeString(token);
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getLoginId() {
        return StringUtil.safeString(loginId);
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    public String getLiveFlag() {
        return StringUtil.safeString(liveFlag);
    }

    public boolean isLiveFlag() {
        return getLiveFlag().equalsIgnoreCase("YES");
    }

    public void setLiveFlag(String liveFlag) {
        this.liveFlag = liveFlag;
    }

    public String getCustomerChangeWalletFlag() {
        return StringUtil.safeString(customerChangeWalletFlag);
    }

    public void setCustomerChangeWalletFlag(String customerChangeWalletFlag) {
        this.customerChangeWalletFlag = customerChangeWalletFlag;
    }

    public boolean isCustomerChangeWalletFlag() {
        return getCustomerChangeWalletFlag().equalsIgnoreCase("YES");
    }
}
